/* GUI CONVERTED from soivmta5.p (converter v1.76) Wed May 22 11:23:26 2002 */
/* soivmta5.p - PROCEDURE TO VALIDATE SITE FOR PENDING INVOICE LINE MAINT     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.4.1.3 $                                                       */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION:  8.5     LAST MODIFIED: 02/02/95   BY:  MWD  *J034*              */
/* REVISION:  8.5     LAST MODIFIED: 10/03/95   BY:  kxn  *J087*              */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KN* myb                */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.4.1.3 $   BY: Jean Miller        DATE: 04/26/02  ECO: *P05V*  */
/* $Revision: eb2 sp3 $   BY: Joy Huang       DATE: 11/03/03  ECO: *HK-S-015*    */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/*                                                                           */
/*****************************************************************************/
/* **NOTE** This subroutine was created for soivmta.p to alleviate problems  */
/*          with the rcode size at compile time.  It places the includes     */
/*          to display messages and text on failure of the site check in a   */
/*          separate  program file.                                          */
/*                                                                           */
/*          Returns a code of 1 for authorized, 0 for NOT so that the calling*/
/*          program can undo, retry as needed.                               */
/*                                                                           */
/*****************************************************************************/
/*  parameters used:                                                         */
/* input variable:         wk_site                 input site                */
/* output variable:        authorized              integer return code       */
/*                                                 1=authorized; 0-not auth  */
/*****************************************************************************/

{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

define input  parameter wk_site    like si_site.
define output parameter authorized as integer.

define shared variable ln_fmt     like soc_ln_fmt.
define shared variable sod_recno   as recid.
define shared variable clines      as integer.
define shared variable line        like sod_line.
define shared variable sodcmmts    like soc_lcmmts label "Comments".
define shared variable mult_slspsn like mfc_logical no-undo.
define shared variable discount    as decimal label "Discount"
   format "->>>9.9<<<".
define shared variable reprice_dtl like mfc_logical.

define variable desc1       like pt_desc1.

define shared frame d.

/*HK-S-015           {soivlnfm.i}*/
/*HK-S-015*/         {xxsoivlnfm.i}

authorized = 0.

find sod_det where recid(sod_det) = sod_recno no-lock no-error.
if available sod_det then do:

   {gprun.i ""gpsiver.p""
      "(input wk_site, input ?, output return_int)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   if return_int = 0 then do:
      if ln_fmt then do:
         /* USER DOES NOT HAVE ACCESS TO DEFAULT SITE XXXX  */
         {pxmsg.i &MSGNUM=2711 &ERRORLEVEL=2 &MSGARG1=wk_site}
         sod_site = "".
         display sod_site with frame d.
      end.
      else do:
         /* USER DOES NOT HAVE ACCESS TO DEFAULT SITE xxxx  */
         {pxmsg.i &MSGNUM=2711 &ERRORLEVEL=3 &MSGARG1=wk_site}
      end.
   end. /* IF RETURN_INT = 0 */

   else
      authorized = 1.

end. /* IF AVAILABLE SOD_DET */
